import { toast } from "../../components/Toast/Toast";
import { KeywordListType } from "../domain/keyword";

export function install(
  val: string,
  keywordList: KeywordListType,
  clearInputCallBack?: () => void
): void {
  if (val.replace("memo ", "").startsWith("add")) {
    clearInputCallBack && clearInputCallBack();
    return;
  }
  if (val.replace("memo ", "").startsWith("remove")) {
    clearInputCallBack && clearInputCallBack();
    return;
  }

  localStorage.setItem(
    "memoStatus",
    localStorage.getItem("memoStatus") === "true" ? "false" : "true"
  );
  location.reload();
}
